Skip to main content

Meta of the Template Archive Specification

JSON Template Archive Meta Structure

Meta Descriptor

propertytyperequireddescription
templateArchiveVersionversionThe template archive version.
templateManagerVersionversion

The version of the template manager which has created the template.

This field is completely ignored by the SDK.

Always written by the template manager. If missing during the read operation of the template manager, the expected version would be substituted with use of the templateArchiveVersion

activeTemplateActiveTemplate

The object containing the paths to the active template and linked resources within the archive to use by SDK. If the field is missing, then the template archive shall be treated as non operational for SDK and can be used only as a templates storage or backup for template manager.

Required for SDK processing.

May be ignored by the template manager on reading. Template manager writes this field only if the archive contains the single template, i.e. the templates array's size is 1. For such case the values for the activeTemplate are obtained from the latest version of the specified single template. If the templates array contains more than one element, then the activeTemplate is expected to be missing.

createdAtdateThe date when the current template archive file has been created.
templateslist(TemplateEntity)

The list of template entities descriptors.

This field is completely ignored by the SDK.

Always written by the template manager. If missing during the read operation of the template manager, then the single template with the 1st version can be created with use of the activeTemplate and additional template meta info (such as name and etc.) provided by the user.

ActiveTemplate Descriptor

propertytyperequireddescription
templatePatharchive pathThe path to the specific JSON template file within the current template archive.
referencePdfPatharchive path

The path to the PDF or IMAGE file which is used by the JSON template (selectors based on PDF). The absence of this field means, that there is no reference PDF for the specified JSON template.

Even though this field is optional in terms of JSON schema, the PDF file (and hence this field) may be required for JSON template processing and template modification in editor. More info about it can be found in Template Archive File Specification.

Mostly used in editor standalone mode.

TemplateEntity Descriptor

Contains all template's data which has no versioning.

propertytyperequireddescription
iduuidThe id of the template.
namestringThe name of the template.
descriptionstringThe description of the template.
createdAtdateThe creation date of the template.
createdByUserThe user which created the template.
updatedAtdateThe last update date of the template
updatedByUserThe user which last updated the template
tagslist(string)

The list of tags specified for the template. If no tags are specified for the template, then the value may be not specified, null or an empty list.

Note: always empty for now since we are not adding tags in first release.

versionslist(TemplateEntityVersion)The list of template versions.

TemplateEntityVersion Descriptor

Contains all template's data which has versioning.

propertytyperequireddescription
versionintegerThe template version starting from 1. Shall be unique in scope of a single template specified by id.
commentstringThe template version comment.
createdAtdate

The creation date of the template version.

Always missing for now since we are not adding this field in first release.

createdByUser

The user which created the template version.

Always missing for now since we are not adding this field in first release.

templatePatharchive pathThe path to the JSON template within the current template archive.
referencePdfPatharchive path

The path to the PDF file which is used by the JSON template (selectors based on PDF). The absence of this field means, that there is no reference PDF for the specified JSON template.

Deprecated since 5.0.0

sampleslist(Sample)The list of samples descriptors.

User Descriptor

propertytyperequireddescription
emailstringThe user's email.

Sample Descriptor

propertytyperequireddescription
namestringThe sample's name.
patharchive pathThe path to the sample file within the current template archive.
documentSourceTypestringSpecifies how to treat the provided document (PDF, IMAGE).
preprocessingTypestringSpecifies how to preprocess the provided document (NONE, OCR).

Meta examples

Full meta.json with single template

Click to expand json
{
"templateArchiveVersion": "1.0.0",
"templateManagerVersion": "1.0.0",
"activeTemplate": {
"templatePath": "templates/AAAAAAAA-2222-2222-2222-222222222222.json",
"referencePdfPath": "references/BBBBBBBB-1111-1111-1111-111111111111.pdf"
},
"createdAt": "2022-01-22T00:00:00.000Z",
"templates": [
{
"id": "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF",
"name": "Some name",
"description": "Some description",
"createdAt": "2022-01-01T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"updatedAt": "2022-02-02T00:00:00.000Z",
"updatedBy": {
"email": "user@email.com"
},
"versions": [
{
"version": 1,
"comment": "Initial version",
"createdAt": "2022-01-01T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"templatePath": "templates/AAAAAAAA-1111-1111-1111-111111111111.json",
"samples": [
{
"name": "image-1.jpeg",
"path": "references/AAAAAAAA-1111-1111-1111-111111111111.jpeg",
"documentSourceType": "IMAGE",
"preprocessingType": "OCR"
},
{
"name": "pdf-1.pdf",
"path": "references/references/BBBBBBBB-1111-1111-1111-111111111111.pdf",
"documentSourceType": "PDF",
"preprocessingType": "NONE"
}
]
},
{
"version": 2,
"createdAt": "2022-01-13T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"templatePath": "templates/AAAAAAAA-1111-1111-1111-111111111111.json",
"samples": [
{
"name": "image-1.jpeg",
"path": "references/AAAAAAAA-1111-1111-1111-111111111111.jpeg",
"documentSourceType": "IMAGE",
"preprocessingType": "OCR"
},
{
"name": "pdf-1.pdf",
"path": "references/references/BBBBBBBB-1111-1111-1111-111111111111.pdf",
"documentSourceType": "PDF",
"preprocessingType": "NONE"
}
]
}
]
}
]
}

Lightweight meta.json

Click to expand json
{
"templateArchiveVersion": "1.0.0",
"activeTemplate": {
"templatePath": "templates/AAAAAAAA-2222-2222-2222-222222222222.json",
"referencePdfPath": "references/BBBBBBBB-1111-1111-1111-111111111111.pdf"
},
"createdAt": "2022-01-22T00:00:00.000Z"
}

Full meta.json with several templates

Click to expand json
{
"templateArchiveVersion": "1.0.0",
"templateManagerVersion": "1.0.0",
"createdAt": "2022-01-22T00:00:00.000Z",
"templates": [
{
"id": "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF",
"name": "Some name",
"description": "Some description",
"createdAt": "2022-01-01T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"updatedAt": "2022-02-02T00:00:00.000Z",
"updatedBy": {
"email": "user@email.com"
},
"versions": [
{
"version": 1,
"createdAt": "2022-01-01T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"templatePath": "templates/AAAAAAAA-1111-1111-1111-111111111111.json",
"samples": [
{
"name": "image-1.jpeg",
"path": "references/AAAAAAAA-1111-1111-1111-111111111111.jpeg",
"documentSourceType": "IMAGE",
"preprocessingType": "OCR"
},
{
"name": "pdf-1.pdf",
"path": "references/references/BBBBBBBB-1111-1111-1111-111111111111.pdf",
"documentSourceType": "PDF",
"preprocessingType": "NONE"
}
]
},
{
"version": 2,
"createdAt": "2022-01-13T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"templatePath": "templates/AAAAAAAA-1111-1111-1111-111111111111.json",
"samples": [
{
"name": "image-1.jpeg",
"path": "references/AAAAAAAA-1111-1111-1111-111111111111.jpeg",
"documentSourceType": "IMAGE",
"preprocessingType": "OCR"
},
{
"name": "pdf-1.pdf",
"path": "references/references/BBBBBBBB-1111-1111-1111-111111111111.pdf",
"documentSourceType": "PDF",
"preprocessingType": "NONE"
}
]
}
]
},
{
"id": "FFFFFFFF-DDDD-DDDD-DDDD-DDDDDDDDDDDD",
"name": "Second template name",
"description": "Second description",
"createdAt": "2022-01-01T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"updatedAt": "2022-02-02T00:00:00.000Z",
"updatedBy": {
"email": "user@email.com"
},
"versions": [
{
"version": 1,
"createdAt": "2022-01-01T00:00:00.000Z",
"createdBy": {
"email": "user@email.com"
},
"templatePath": "templates/AAAAAAAA-5555-5555-5555-555555555555.json",
"samples": [
{
"name": "image-1.jpeg",
"path": "references/AAAAAAAA-1111-1111-1111-111111111111.jpeg",
"documentSourceType": "IMAGE",
"preprocessingType": "OCR"
},
{
"name": "pdf-1.pdf",
"path": "references/references/BBBBBBBB-1111-1111-1111-111111111111.pdf",
"documentSourceType": "PDF",
"preprocessingType": "NONE"
}
]
}
]
}
]
}